<?php
/*
 * Created on Mar 27, 2009
 * author: ANH
 * fileName: IndexController.php
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
 class Gallery_IndexController extends Clu_Controller_Action_Hvn
{
	public function init()
	{
		$this->m = new gallery_Model_Gallery();
	}
	
	public function indexAction()
	{
		
	
	}
 	public function postAction()
	{
		$form= new gallery_Form_Gallery();
		$this->view->form = $form;
		
		if($this->_request->isPost())
		{
			$formData = $this->_request->getPost();
			if ($form->isValid($formData)) {
				$this->m->postImage($createWM = true);
			}	
			else
			{
				$form->populate($formData);
			}
		}
		$this->renderToHolder('index/post.phtml');
	}
}
?>
